# -*- coding: utf-8 -*-

from openerp import models, fields, api

class account_analytic_account(models.Model):
    _inherit = 'account.analytic.account'

    state=fields.Selection([
        ('template', 'Template'),
        ('draft','New'),
        ('open','In Progress'),
        ('pending','To Renew'),
        ('close','Closed'),
        ('cancelled', 'Cancelled'),
        ('confirmed',u'市场组审核'),
        ('marketconfirmed',u'销售总监审核'),
        ('saleconfirmed',u'财务经理审核'),
        ('financialconfirmed',u'律师审核'),
        ('lawyerconfirmed',u'总经理审核'),
        ('managerconfirmed',u'合同通过')],default='draft')
    
    @api.one
    def action_draft(self):
        self.write({'state':'draft'})

    @api.one
    def action_confirm(self):
        self.write({'state':'confirmed'})

    @api.one
    def action_marketconfirm(self):
        self.write({'state':'marketconfirmed'})

    @api.one
    def action_saleconfirm(self):
        self.write({'state':'saleconfirmed'})

    @api.one
    def action_financialconfirm(self):
        self.write({'state':'financialconfirmed'})

    @api.one
    def action_lawyerconfirm(self):
        self.write({'state':'lawyerconfirmed'})

    @api.one
    def action_managerconfirm(self):
        self.write({'state':'managerconfirmed'})
